package com.xyh.transaction.controller;

import com.xyh.transaction.entity.Permission;
import com.xyh.transaction.response.ResponseResult;
import com.xyh.transaction.service.PermissionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Api(tags = "权限管理")
@RestController
@RequestMapping("permission")
public class PermissionController {

    @Autowired
    private PermissionService permissionService;


    @ApiOperation(value = "权限列表接口",notes = "返回所有权限列表")
    @GetMapping("list")
    public ResponseResult<List<Permission>> list(){
        List<Permission> permissionList = permissionService.getPermissionList();
        return ResponseResult.success("操作成功！",permissionList);
    }


}
